import serial

ser = serial.Serial('/dev/ttyACM0', 9600, timeout=.1)
while 1:
	line = ser.readline()
	if(line == 'G\n'):
		print 'gyro!'
		line = ser.readline()	
		valuea = line.strip('\n')
		int_1 = int(valuea)	
		print int_1*.2

		line = ser.readline()	
		valuea = line.strip('\n')
		int_2 = int(valuea)	
		print int_2*.2

		line = ser.readline()	
		valuea = line.strip('\n')
		int_3 = int(valuea)	
		print int_3*.2
	   	print '\n'

	line = ser.readline()
	if(line == 'A\n'):
		print 'accl!'
		line = ser.readline()	
		valuea = line.strip('\n')
		int_1 = int(valuea)	
		print int_1*.2

		line = ser.readline()	
		valuea = line.strip('\n')
		int_2 = int(valuea)	
		print int_2*.2

		line = ser.readline()	
		valuea = line.strip('\n')
		int_3 = int(valuea)	
		print int_3*.2
	   	print '\n'

	line = ser.readline()
	if(line == 'C\n'):
		print 'cmps!'
		line = ser.readline()	
		valuea = line.strip('\n')
		int_1 = int(valuea)	
		print int_1*.2

		line = ser.readline()	
		valuea = line.strip('\n')
		int_2 = int(valuea)	
		print int_2*.2

		line = ser.readline()	
		valuea = line.strip('\n')
		int_3 = int(valuea)	
		print int_3*.2
	   	print '\n'

